package com.feign.controller;

import com.feign.entity.StudentEntity;
import com.feign.feign.FeignProviderClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

@RestController
@RequestMapping("/feign")
public class FeignController {
    @Autowired
    private FeignProviderClient feignProviderClient;

    @GetMapping("/all")
    public Collection<StudentEntity> all(){
        return feignProviderClient.all();
    }
    @GetMapping("/index")
    public String index(){
        return feignProviderClient.index();
    }
}
